package com.google.coffeeshop.dao.impl;

import java.util.List;

import com.google.coffeeshop.dao.SeatDAO;
import com.google.coffeeshop.entity.SeatDTO;
import com.googlecode.genericdao.search.Search;


public class SeatDAOImpl extends AbstractBaseDAOImpl<SeatDTO, Long> implements SeatDAO {

	@Override
	public List<SeatDTO> findWithoutNewAndTerminatedStatus() {
		Search search = new Search(SeatDTO.class);
		search.setFirstResult(0);
		search.setMaxResults(Integer.MAX_VALUE);
		search.addFilterNotEqual("status", new Integer(1)); // without NEW
		search.addFilterNotEqual("status", new Integer(5)); // without TERMINATED
		return this.search(search);
	}

	@Override
	public List<SeatDTO> findByStatus(Integer statusId) {
		Search search = new Search(SeatDTO.class);
		search.setFirstResult(0);
		search.setMaxResults(Integer.MAX_VALUE);
		search.addFilterEqual("status", statusId);
		return this.search(search);
	}
	
}
